/**
 * 
 */
package structure_pattern.composite_pattern;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Administrator
 *
 */
public class Employee {
	private String name;
	private String dept;
	private int salary;
	private List<Employee> subordinates;
	
	

	/**
	 * @param name
	 * @param dept
	 * @param salary
	 * @param subordinates
	 */
	public Employee(String name, String dept, int salary) {
		this.name = name;
		this.dept = dept;
		this.salary = salary;
		this.subordinates = new ArrayList<Employee>();
	}
	
	public void add(Employee e){
		subordinates.add(e);
	}
	public void remove(Employee e) {
      subordinates.remove(e);
   }
	 public List<Employee> getSubordinates(){
	     return subordinates;
	   }

	public String toString(){
	      return ("Employee :[ Name : "+ name 
	      +", dept : "+ dept + ", salary :"
	      + salary+" ]");
	   }   
}
